import request from '../../../components/Request';


export async function listCategory(type) {
  let result = await request.post({
    url: './common/listCategory.do',
    data: {type: type},
  });
  return result.data;
}

export async function insertCategory(data) {
  let result = await request.post({
    url: './common/insertCategory.do',
    data: {...data, type: 1},
  });
}

export async function deleteCategory(id) {
  let result = await request.post({
    url: './common/deleteCategory.do',
    data: {id: id},
  });
}

